<template>
	<!-- <view class="content"v-if="payType == 1">
		
			<view class="qr-box code-img">
				<canvas canvas-id="qrcode" />
			</view>
			
			<view class="titles">请保存二维码或者截图使用{{this.payType == 2?'支付宝':'微信'}}扫码支付</view>
			<view class="titles">支付成功后可在账单明细中查看</view>
		
	</view> -->
</template>

<script>
	import uQRCode from '@/common/uqrcode.js'
	export default {
		data() {
			return {
				payUrl:'',
				payType:'',   // 2 支付宝  1 微信
			}
		},
		onLoad(e) {
			this.payUrl = e.payUrl
			this.payType = e.payType
			// this.qrFun(this.payUrl) //调用二维码方法
			//#ifdef APP-PLUS
			plus.runtime.openURL(this.payUrl)
			//#endif
			
			//#ifdef H5
			window.location.href = this.payUrl
			//#endif
			
		},
		methods: {
			qrFun(text) {
				uQRCode.make({
					canvasId: 'qrcode',
					componentInstance: this,
					text: text,
					size: 120,
					margin: 0,
					backgroundColor: '#ffffff',
					foregroundColor: '#000000',
					fileType: 'jpg',
					errorCorrectLevel: uQRCode.errorCorrectLevel.H,
					success: res => {
						var that = this
						uni.canvasToTempFilePath({
							canvasId: 'qrcode',
							success: function(res) {
								uni.setStorageSync('ewmImg', res.tempFilePath)
								console.log(res,'resresres')
							}
						})
					}
				})
			},
		}
	}
</script>

<style>
.content {
	display: flex;
	align-items: center;
	flex-direction: column;
	justify-content: center;
}
.code-img {
	width: 245rpx;
	height: 245rpx;
	margin-top: 200rpx;
}
.titles {
	margin-top: 40rpx;
	font-size: 26rpx;
	color: rgb(153, 153, 153);
}
.webView {
	width: 100vw;
	height: 100vh;
}
</style>
